import { ConfigProvider } from 'antd';
import ReactDOM from 'react-dom';
import zh_CN from 'antd/es/locale/zh_CN';
import { BrowserRouter, Switch, Route } from 'react-router-dom';

import Workbench from './Workbench'
import MainLayout from './layout/MainLayout';
import Login from './pages/login';
import lazyload from './utils/lazyload';

ReactDOM.render(
  <BrowserRouter>
    <ConfigProvider
      locale={zh_CN}

    >


      <Switch>
        <Route path="/login" component={Login} />
        <Route exact path="/" component={lazyload(() => import('./pages/home/index'))}>
          {/* <Redirect to={`${defaultRoute}`} /> */}
        </Route>

        <Route exact path="/stars" component={lazyload(() => import('./pages/stars/index'))}>
          {/* <Redirect to={`${defaultRoute}`} /> */}
        </Route>
        
      
        <Route path="/workbench*" component={Workbench} />

        <Route exact path="*" component={lazyload(() => import('./pages/exception/404'))}>
        </Route>
      </Switch>

    </ConfigProvider>
  </BrowserRouter>
  , document.getElementById('root'));